<template>
  <header id='head_top'>
    <slot name='logo'></slot>
    <slot name='search'></slot>
    <section class="head_goback" v-if="goBack" @click="this.$router.go(-1)">
      <svg width="100%" height="100%" xmlns="http://www.w3.org/2000/svg" version="1.1">
        <polyline class="back" points="12,18 4,9 12,0" style="fill:none;stroke:rgb(250,47,93);stroke-width:2"/>
      </svg>
    </section>
    <section class="head_goback" v-if="toHome" >
      <router-link to="/">
      <svg width="100%" height="100%" xmlns="http://www.w3.org/2000/svg" version="1.1">
        <polyline class="back" points="12,18 4,9 12,0" style="fill:none;stroke:rgb(250,47,93);stroke-width:2"/>
      </svg>
      </router-link>
    </section>
    <section class="title_head ellipsis" v-if="headTitle">
      <span class="title_text">{{decodeURI(headTitle)}}</span>
    </section>
    <slot name="edit"></slot>
    <slot name="msite-title"></slot>
    <slot name="changecity"></slot>
    <slot name="changeLogin"></slot>
  </header>
</template>

<script>
  import {mapState, mapActions} from 'vuex'
  import svgIcon from '../../components/common/svg'
  export default {
    name: "head",
    props: ['signinUp', 'headTitle', 'goBack','msiteTitle','toHome'],
    data(){
      return {

      }
    },
    components:{
      svgIcon
    }
    /*computed: {
      ...mapState([
        'userInfo'
      ]),
    },
    methods: {
      ...mapActions([
        'getUserInfo'
      ]),
    }*/
  }
</script>

<style lang="scss"  scoped>
  @import "../../style/common";
  @import "../../style/mixin";


  #head_top{
  position: fixed;
  z-index: 100;
  left: 0;
  top: 0;
  @include wh(100%, 1.95rem);
  }
  .select_input{position: fixed;left: 0;top: 0;z-index: 1000;width: 100%;}
  .select_input input[type=text]{width: 7rem;margin:.2rem 0.25rem;box-shadow: 0 0 10px 0 #999;height: .65rem;border: none;border-radius: .5rem;padding: 0.1rem 0.2rem;opacity: 0.8;font-size:0.24rem;}
  .select_input img{position: absolute;right: 0.55rem;top: 0.3rem;width: 0.5rem;z-index: 1000;}
  .title_head{height: 1.05rem;line-height:1.05rem;text-align: center;font-size: 0.4rem;color: #030303;}
  .title_head .title_text{font-size:0.4rem}
  #head_top{background: #fff;height: 1.05rem;line-height:1.05rem;position: fixed;}
  .head_goback{height: 1.05rem;line-height:1.05rem;float:left;height: .5rem;position: absolute;left: 0.2rem;top: 0.3rem;width: 1rem;}
</style>


